package cn.virens.common.util.fastjson.reader;

import com.alibaba.fastjson2.JSONReader;
import com.alibaba.fastjson2.reader.ObjectReader;
import org.dromara.hutool.core.convert.ConvertUtil;

import java.lang.reflect.Type;

public final class SimpleConvertReader implements ObjectReader<Object> {
    public final static SimpleConvertReader instance = new SimpleConvertReader();

    @Override
    public Object readObject(JSONReader jsonReader, Type type, Object o, long l) {
        return ConvertUtil.convert(type, jsonReader.readAny());
    }
}